home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / exsyslib / examples / example2.s < prev    next >
Text File  |  1980-01-03  |  2KB  |  62 lines

  1. *****************************************************************************
  2. * Example 2 of using the 'exsys.library' (using the supplied include file)
  3. * ---------------------------------------------------------------------------
  4. * This example setsup a level 3 interrupt using the REAL vectorbase address
  5. * (works with all MC680x0 cpu processors not just the MC68000 like many others
  6. * I`ve seen in the past which don`t use the vectorbase...
  7. *
  8. * NB: There is no need to save/restore interrupt vectors for interrupts, its
  9. * all done automatically for you by the library routines!!!!
  10. ******************************************************************************
  11.  
  12.         incdir    'work:Exsyslib/'
  13.         include    'include/hardware/custom.i'    ;define customchips
  14.         include    'include/hardware/exsys_takeover.s' ;1st codeline!
  15.  
  16. *-------------- Install a new copperlist..
  17.  
  18.         lea    my_copper(pc),a0
  19.         bsr.s    newcopper
  20.  
  21. *-------------- Install a new level 3 interrupt..
  22.         
  23.         lea    my_interrupt(pc),a0    ;ptr to our interrupt..
  24.         move.l    _OSVBR(a4),a1        ;get VBR..
  25.         move.l    a0,$6c(a1)        ;install interrupt..
  26.  
  27. *-------------- wait for Left Mouse before exiting..
  28.  
  29. test        btst    #6,$bfe001        ;exit on left mouse...
  30.         bne.s    test
  31.         rts                ;return to os..
  32.  
  33. *****************************************************************************
  34. * Our shiny new level 3 in action..!
  35.  
  36. my_interrupt:    movem.l    d0-d7/a0-a6,-(sp)
  37.  
  38.         move.w    $dff006,$dff180        ;FLASH SCREEN!
  39.  
  40.         movem.l    (sp)+,d0-d7/a0-a6
  41.         move.w    #$20,$dff09c        ; clear request
  42.         rte
  43.  
  44. ******************************************************************************
  45. * Turn on a new copperlist
  46.  
  47. newcopper:    lea     $dff000,a6        ;a6=custom hardware
  48.         move.w    #$7fff,$96(a6)        ;no dma
  49.         move.l    a0,$80(a6)        ;install new copperlist ptr
  50.         clr.w    $88(a6)            ;strobe copper
  51.         move.w    #$83c0,$96(a6)        ;enable copper dma
  52.         rts
  53.  
  54. *****************************************************************************
  55. * Our new copperlist...
  56.         
  57. my_copper:    dc.w    diwstrt,$2c81,diwstop,$2cc1
  58.         dc.w    ddfstrt,$0038,ddfstop,$00d0
  59.         dc.w    bplcon0,$0200            ;no bitplanes
  60.         dc.w    $180,$000f            ;color 0
  61.         dc.l    -2
  62.